/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package codeclz77.teste;

import codeclz77.Code;
import codeclz77.bean.Lz77;
import codeclz77.bean.Triplet;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;
import java.util.List;

/**
 *
 * @author Douglas
 */
public class Teste {
    
    public static void main(String args[]){
        
        String palavraTeste = "borboleta_atiria";
        char[] arrayTeste = palavraTeste.toCharArray();
        System.out.println("Olá mundo!");
        Lz77 lz = new Lz77((char)10, (char)10, new ArrayDeque<Character>(), 0, new ArrayList<Triplet>());
        Code code = new Code(lz);
        for(int i=0; i < arrayTeste.length ; i++){
            code.addSymbol(arrayTeste[i]);
        }
        code.addFinal();
        List<Triplet> list = lz.getTriplet();
        
        for(int i = 0; i < list.size(); i++){
            System.out.println(list.get(i).getOffset() + "");
            System.out.println(list.get(i).getMatchLength() + "");
            System.out.println(list.get(i).getCodeword() + "");
        }
        
        
        
    }
    
}
